/*  coding=utf-8     
   @auther: sheep   
   @create time:    
   @description:  */
#include<stdio.h>
#include<stdlib.h>

typedef char TElemType;
typedef struct BiTNode
{
	TElemType data;
	struct BiTNode *lchild, *rchild;
} BiTNode, *BiTree;

void PreOrderTraverse(BiTree T);
void InOrderTravese(BiTree T);
void PostOrderTravese(BiTree T);
void CreateBiTree(BiTree *T);

int main()
{
	return 0;
}

void PreOrderTraverse(BiTree T)
{
	if(T==NULL)
		return;
	printf("%c", T->data);
	PreOrderTraverse(T->lchild);
	PreOrderTraverse(T->rchild);
}

void InOrderTravese(BiTree T)
{
	if(T==NULL)
		return;
	InOrderTravese(T->lchild);
	printf("%c", T->data);
	InOrderTravese(T->rchild);
}

void PostOrderTravese(BiTree T)
{
	if(T==NULL)
		return;
	PostOrderTravese(T->lchild);
	PostOrderTravese(T->rchild);
	printf("%c", T->data);
}

void CreateBiTree(BiTree *T)
{
	TElemType ch;
	scanf("%c", &ch);
	if(ch=='#')
		*T = NULL;
	else
	{
		*T=(BiTree)malloc(sizeof(BiTNode));
		if(!*T)
			exit(EXIT_FAILURE);
		(*T)->data=ch;
		CreateBiTree(&(*T)->lchild);
		CreateBiTree(&(*T)->rchild);
	}
}
